Private Sub Assign(ByVal npreq1) ' npreq = np request np = actual Dim trace As Integer Dim text$ trace = 0 If trace_pp = 1 Then trace = 1 If trace = 1 Then text$ = "Assign np " + Str(np) + " npreq" + Str(npreq1) If trace_pp = 1 Then DISPLAY1(indd1, text$) Else Debug.Print(text$) End If End If If npreq1 > np Then For i = 1 To npreq1 text$ = "" Application.DoEvents() Select Case i Case Is = 1 npl(i) = npreq1 If trace = 1 Then text$ = "Assign " + Str(i) Case Is = 2 npl(i) = npreq1 Form4.BackgroundWorker1.RunWorkerAsync(i) If trace = 1 Then text$ = "Assign " + Str(i) Case Is = 3 npl(i) = npreq1 Form4.BackgroundWorker2.RunWorkerAsync(i) If trace = 1 Then text$ = "Assign " + Str(i) Case Is = 4 npl(i) = npreq1 Form4.BackgroundWorker3.RunWorkerAsync(i) If trace = 1 Then text$ = "Assign " + Str(i) End Select If text$ <> "" Then If trace_pp = 1 Then DISPLAY1(indd1, text$) Else Debug.Print(text$) End If End If Application.DoEvents() Next i End If np = npreq1 If trace = 1 Then text$ = "Assign np " + Str(np) + " npreq1" + Str(npreq1) If trace_pp = 1 Then DISPLAY1(indd1, text$) Else Debug.Print(text$) End If End If Form4.Tnp.Text = Str(np) End Sub